Skip to main content
Version: 0.1.3

Quickstart

This guide walks you through setting up and using ProtonX to create text embeddings.

Get Your API Key

  1. Visit ProtonX Platform to sign up.
  2. Generate your API key from the dashboard.
  3. Save the key securely for use in your application.

Example: Creating a Text Embedding (Python)

Use the ProtonX Python library.

from protonx import ProtonX

# Initialize the ProtonX client with your API key
client = ProtonX(api_key="your_api_key")

# Create an embedding
text = "Tôi yêu Việt Nam"
result = client.embeddings.create(text)

Example: Creating a Text Embedding (JavaScript)

Use the ProtonX JavaScript/TypeScript library.

import { ProtonX } from "protonx";

const client = new ProtonX({
apiKey: "your_api_key_here"
});

const run = async () => {
const res = await client.embeddings.create({
input: "Tôi yêu Việt Nam",
});
console.log(res);
};

run();

Example: Response


{'data': [{'index': 0, 'embedding': [-0.028941236436367035, 0.07183849066495895, -0.07457461208105087, -0.03135333210229874, -0.08524372428655624, 0.004628618713468313, -0.004927726462483406, 0.05318081006407738, 0.09767699241638184, -0.007289595436304808, 0.04313383251428604, 0.007354601286351681, 0.09026229381561279, 0.08222875744104385, 0.01696515642106533, 0.08394050598144531, -0.02994586154818535, 0.07777843624353409, 0.02472934126853943, -0.0123545927926898, -0.006773304659873247, 0.06453055888414383, -0.018824845552444458, 0.029352178797125816, -0.06710100919008255, -0.01958293467760086, -0.07250885665416718, -0.0036435932852327824, -0.006284329108893871, 0.005739166401326656, -0.036007076501846313, -0.04084969684481621, 0.08377399295568466, 0.03235357254743576, -0.009334659203886986, -0.030701501294970512, 0.03509778529405594, 0.018447861075401306, -0.026051640510559082, 0.08974697440862656, 0.028941793367266655, 0.005834897514432669, -0.04672222584486008, 0.01383668277412653, -0.11122749745845795, 0.008991892449557781, 0.04335780069231987, 0.031109290197491646, -0.00018002420256379992, -0.04963896796107292, -0.01827504113316536, -0.03347761556506157, -0.08662430942058563, 0.0076209185644984245, 0.05576157197356224, 0.014647633768618107, 0.029044970870018005, 0.004702093079686165, 0.019185518845915794, -0.0009448673226870596, -0.04353462532162666, -0.021137911826372147, 0.09360356628894806, 0.007859540171921253, -0.003188983304426074, -0.06298048794269562, -0.016330918297171593, -0.01081770472228527, -0.06427635252475739, 0.018546586856245995, -0.009338675998151302, -0.0007220994448289275, -0.03141573816537857, 0.018421290442347527, -0.0105365552008152, -0.04243013635277748, -0.015724677592515945, -0.026029743254184723, -0.03636336326599121, 0.03908488154411316, -0.035628791898489, -0.023087361827492714, -0.0031500495970249176, 0.025820083916187286, 0.01940881460905075, -0.08048362284898758, 0.022701308131217957, 0.030189333483576775, -0.007384866010397673, -0.05484175309538841, -0.016992956399917603, 0.024850787594914436, -0.023192796856164932, 0.009864932857453823, -0.08637043833732605, 0.016600891947746277, -0.025351040065288544, -0.03689580038189888, -0.06809738278388977, 0.05231676995754242, -0.027142776176333427, 0.00968352984637022, -0.0015431222273036838, 0.0493866503238678, 0.026339808478951454, 0.015777703374624252, 0.022812550887465477, -0.04112384095788002, -0.03668951615691185, -0.025523925200104713, -0.011745357885956764, 0.011540279723703861, -0.01458545122295618, -0.00818032119423151, -0.015264970250427723, -0.054191865026950836, -0.012121390551328659, -0.0203696396201849, 0.029289482161402702, 0.02480478771030903, 0.00010593437036732212, 0.0475350059568882, -0.01445082575082779, -0.016603384166955948, -0.04323134571313858, 0.11822137236595154, 0.014156111516058445, 0.023374386131763458, -0.004824044648557901, -0.016268722712993622, 0.00925651378929615, -0.026003489270806313, -0.009561697952449322, 0.0006456348928622901, 0.014697005972266197, 0.00535592483356595, -0.03771061822772026, 0.008518864400684834, -0.07891542464494705, -0.012546086683869362, -0.011277236044406891, -0.011786122806370258, 0.0005227028741501272, 0.01885206438601017, 0.041190143674612045, 0.005924686789512634, 0.011475048027932644, -0.01514421682804823, -0.024544963613152504, -0.0444791354238987, -0.015692392364144325, -0.02788800373673439, 0.010375207290053368, -0.0076079475693404675, -0.08201788365840912, 0.014024254865944386, 0.013514630496501923, -0.044194646179676056, -0.008473572321236134, -0.05209646001458168, -0.017460735514760017, 0.03611866757273674, -0.01204949151724577, 0.014800863340497017, 0.026643000543117523, -0.04205581173300743, 0.009605269879102707, -0.027366675436496735, -0.027014220133423805, -0.05712424963712692, -0.03354477882385254, -0.034488800913095474, 0.02420005016028881, 0.047719791531562805, 0.025035277009010315, 0.030351189896464348, 0.013568735681474209, 0.004436865448951721, -0.027975354343652725, 0.015722054988145828, 0.02327108383178711, -0.07530370354652405, -0.005964308045804501, -0.01981007680296898, -0.02978343889117241, -0.042238131165504456, -0.006518292240798473, 0.02614973485469818, -0.01509491540491581, -0.04207152873277664, -0.001229556044563651, -0.02453587017953396, -0.01446705125272274, 0.04505655914545059, 0.002398793352767825, 0.013026396743953228, 0.016379138454794884, -0.01190988440066576, -0.004187922924757004, 0.05288499593734741, 0.04577929154038429, 0.006333332508802414, -0.008595982566475868, 0.025881262496113777, -0.008498427458107471, 0.015485229901969433, -0.04352496564388275, 0.07072755694389343, 0.00022597765200771391, 0.0038328764494508505, 0.07814802974462509, 0.06365690380334854, -0.006330815609544516, 0.017164679244160652, -0.0313846729695797, -0.004729637876152992, 0.03424670919775963, -0.06121661886572838, -0.0027713216841220856, -0.005043657962232828, 0.027997704222798347, -0.02156391553580761, -0.0007908897823654115, 0.003458756720647216, 0.01665809191763401, -0.04515150934457779, 0.07636535912752151, 0.0011261414038017392, 0.027002375572919846, -0.03490791469812393, 0.01780969649553299, 0.004598777275532484, 0.02342613972723484, 0.033229243010282516, 0.030896315351128578, 0.00741910096257925, -0.03350578993558884, -0.01758827641606331, 0.00926277693361044, -0.007425765506923199, -0.037883587181568146, 0.02381766028702259, 0.03534199297428131, -0.06628108024597168, 0.010956348851323128, -0.007731247693300247, -0.001774636097252369, 0.025714324787259102, -0.03537208214402199, -0.06160242483019829, 0.006806866731494665, -0.039769113063812256, -0.022859936580061913, 0.04401933029294014, 0.00150352215860039, 0.039559971541166306, 0.025585945695638657, -0.0061318338848650455, 0.023225517943501472, 0.017434654757380486, 0.02177967131137848, -0.02130364440381527, -0.000590174866374582, -0.008742020465433598, 0.04116237908601761, 0.0032222834415733814, 0.010053453035652637, -0.018462879583239555, 0.053101036697626114, 0.035270314663648605, 0.05517081543803215, -0.02641638182103634, -0.06708870083093643, 0.026236768811941147, 0.06168931722640991]}], 'usage': {'prompt_tokens': 4, 'total_tokens': 4, 'processing_time': 0.129926, 'num_texts': 1, 'average_tokens_per_text': 4.0, 'max_tokens_per_text': 4, 'min_tokens_per_text': 4, 'truncated_texts': 0, 'max_length': 4096}}